/**
 * Document   : validate some control
 * Created on : Mar 15, 2013, 23:25:58 PM
 * Author     : duonghung1369
 *
 * */

/**
 * Check that product is still in stocked.
 */
function isStillProductInStock(id, quantity){
    var index = cartObj.getIndexOfItem(id);
    
    // check that product exist in cart
    if(index != ERROR){
        if(cartObj.items[index].amount < quantity){
            return true;
        }else {
            return false;
        }
    }else{
        return true;
    }

}

